import request from '@/utils/request.js'

// 获取员工列表
export function sysUser(params) {
    return request({
        url: '/sys/user',
        params
    })
}

// 新增员工
export function sysUserPost(data) {
    return request({
        url: '/sys/user',
        method: 'post',
        data
    })
}

// 删除员工
export function sysUserDel(id) {
    return request({
        url: '/sys/user/' + id,
        method: 'delete',
    })
}

// 批量导入员工
export function sysUserBatch(data) {
    return request({
        url: '/sys/user/batch',
        method: 'post',
        data
    })
}
// 修改员工基本信息
export function sysUserPut(data) {
    return request({
        url: `/sys/user/${data.id}`,
        method: 'put',
        data
    })
}

// 获取员工个人信息
export function employeesIdPersonalInfo(id) {
    return request({
        url: `/employees/${id}/personalInfo`
    })
}

// 更改员工个人信息
export function employeesIdPersonalInfoPut(data) {
    return request({
        url: `/employees/${data.userId}/personalInfo`,
        method: 'put',
        data

    })
}

// 获取员工岗位信息
export function employeesIidJobs(id) {
    return request({
        url: `/employees/${id}/jobs`,
    })
}

// 修改员工岗位信息
export function employeesIidJobsPut(data) {
    return request({
        url: `/employees/${data.userId}/jobs`,
        method: 'put',
        data
    })
}